package maze.net;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;

public class SGMPInputStream {

	private ObjectInputStream in;

	public SGMPInputStream(InputStream stream) throws IOException {
		in = new ObjectInputStream(stream);
	}

	public MessageType readHeader() throws IOException {
		try {
			MessageType type = (MessageType) in.readObject();
			return type;
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		return null;
	}

	public byte readByte() throws IOException {
		return in.readByte();
	}

	public int readInt() throws IOException {
		return in.readInt();
	}

	public long readLong() throws IOException {
		return in.readLong();
	}

	public short readShort() throws IOException {
		return in.readShort();
	}
}
